<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<ul id="ul">
    <li>北京</li>
    <li>上海</li>
    <li>广州</li>
    <li>重庆</li>
</ul>
<script type="text/javascript">
    var ul=document.getElementById('ul');
    var childs=ul.childNodes;
    console.log(childs);

    //nextSibling/previousSibling
    var guang=document.getElementsByTagName("li")[2];
//    console.log(guang);
    console.log(guang.nextSibling.nextSibling);//<li>重庆</li>
//    console.log(guang.previousSibling.previousSibling);//<li>上海<li/>
//
//    console.log(guang.childNodes.length);
</script>
</body>
</html>